package com.strato.mvc.api.v1_0_0.control;

import java.util.ArrayList;
import java.util.List;

public class PathVariableCollector {

	private List<PathVariable> pvs=new ArrayList<PathVariable>();
	
	public void collect(PathVariable pv){
		pvs.add(pv);
	}
	
	public List<PathVariable> getCollectedPathVariables(){
		return pvs;
	}

	public PathVariable getPathVariable(String name) {
		for(PathVariable pv:pvs){
			if(pv.getName().equals(name)){
				return pv;
			}
		}
		return null;
	}
}
